package com.qingsong.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.Contact;

/**
 * @author qingsong
 */
@Configuration
public class SpringDocConfig {

    private final String AUTHOR = "qingsong";
    private final String URL = "http://localhost:5200";
    private final String TITLE = "ml-user";
    private final String DESCRIPTION = "<em>MyLesson - 用户微服务</em>";
    private final String VERSION = "v1.0.0";

    /**
     * 通用信息Bean
     */
    @Bean
    public OpenAPI commonInfo() {
        return new OpenAPI().info(new Info()
                .title(TITLE)
                .description(DESCRIPTION)
                .version(VERSION)
                .contact(new Contact().name(AUTHOR).url(URL)));
    }
}